<template>
  <div>
    <div class="banner" @click='show = true'>
      <img :src="bannerImg" alt="" class="banner-img">
      <div class="banner-info">
        <div class="banner-title">{{sightName}}</div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe64a;</span>
          {{number}}
        </div>
      </div>
    </div>
    <fade-animation>
        <banner-gallary :imgList='gallaryImgs' v-show="show" @close='show = false'></banner-gallary>
    </fade-animation>
  </div>
</template>

<script>
import BannerGallary from '@/common/gallary/Gallary'
import FadeAnimation from '@/common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    number: Number,
    gallaryImgs: Array
  },
  components: {
    BannerGallary,
    FadeAnimation
  },
  data () {
    return {
      show: false
    }
  }
}
</script>

<style lang="stylus" scoped>
.banner
  position relative
  overflow hidden
  height 0
  width 100%
  padding-bottom 55%
  .banner-img
    width 100%
  .banner-info
    display flex
    position absolute
    bottom 0
    left 0
    right 0
    line-height .6rem
    color #fff
    background-image linear-gradient(to top, rgba(0,0,0,0), rgba(0,0,0,.8rem))
    .banner-title
      flex 1
      font-size .32rem
      padding 0 .2rem
    .banner-number
      font-size .24rem
      line-height .32rem
      padding .2rem
      .banner-icon
        font-size .24rem
</style>
